package com.foo.ui_demo_widge;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class InformationActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_information);
        //获取意图
        Intent intent = getIntent();
        String message= intent.getStringExtra(LoginActivity.EXTRE_MESSAGE);
        //在TextView中显示
        TextView textView = findViewById(R.id.tt_username);
        textView.setText("用户名:"+message);
        Button btn_details = findViewById(R.id.btn_details);
        btn_details.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
               sendMessage(v);
            }
        });
    }
    public void sendMessage(View v){
        Log.i("MyDebug","响应按钮点击事件");
        Intent intent = new Intent(this,UserDetailsActivity.class);
        //找到文本内容

        //把数据附加到intent上
        //执行意图
        startActivity(intent);
    }
}